/*
 * Copyright 2016-2019 yoara
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package yhao.infra.web;

/**
 * web-base 配置类
 *
 * <ul>
 *     <li>redis</li>
 *     <li>cross拦截器配置</li>
 * </ul>
 *
 * @author yoara
 */
public class ConfigFactory {
    //cookie取sessionId，sessionId名称
    public static final String REDIS_SESSION_FILTER_SESSION_ID = "redisSession.filter.sessionId";
    //cookie取sessionId的域名
    public static final String REDIS_SESSION_FILTER_COOKIE_DOMAIN = "redisSession.filter.cookieDomain";
    //cookie取sessionId的路径
    public static final String REDIS_SESSION_FILTER_COOKIE_PATH = "redisSession.filter.cookiePath";
    //通过request Header获取sessionId，定义获取键
    public static final String REDIS_SESSION_FILTER_SESSION_ID_HEADER_KEY = "redisSession.filter.sessionIdHeaderKey";
    //通过request Header获取sessionSource，定义获取来源
    public static final String REDIS_SESSION_FILTER_SESSION_SOURCE_HEADER_KEY = "redisSession.filter.sessionSourceHeaderKey";
    //redisSession的有效时间，单位为秒
    public static final String REDIS_SESSION_EXPIRE_TIME = "redisSession.expireTime";
    //是否开启跨域请求限制
    public static final String SWITCH_CROSS_ORIGIN_INTERCEPTOR_IS_OPEN = "switch.crossOriginInterceptor.isOpen";

    //访问阈值控制的间隔时间，单位为秒，默认1秒
    public static final String ACCESS_FILTER_THROTTLING_INTERVAL = "access.filter.throttlingInterval";
    //单一session阈值时间内可访问次数，默认5
    public static final String ACCESS_FILTER_MAX_ACCESS_COUNT_PER_SESSION = "access.filter.maxAccessCountPerSession";
    //单一ip阈值时间内可访问次数，默认20
    public static final String ACCESS_FILTER_MAX_ACCESS_COUNT_PER_IP = "access.filter.maxAccessCountPerIP";
    //阈值限制的白名单url，多个用','隔开
    public static final String ACCESS_FILTER_BYPASS_RESOURCES = "access.filter.bypassResources";

}
